type: object
required: ["addressPools"]
properties:
  addressPools:
    type: array
    default: []
    description: |
      A list of IP ranges to assign to services.

      Format — a data array similar to that of [MetalLB's](https://metallb.universe.tf/configuration/#advanced-address-pool-configuration).
    items:
      type: object
      properties:
        name:
          type: string
          description: |
            The name of the pool (you can specify it using the service annotation as follows: `metallb.universe.tf/address-pool: <name>`). It should conform to RFC 1123: dot-separated parts in lowercase, consists of alphanumeric characters, '-'. Each part must start and end with an alphanumeric character.
          pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$'
        addresses:
          type: array
          description: |
            A list of ranges, where each range can look like a subnet/mask or a numeric address range (with "-" as a delimiter).

            **Caution!** The address ranges must be available for use on frontend nodes and must not overlap with the addresses of existing cluster nodes.
          items:
            type: string
            oneOf:
            - pattern: '^([0-9]{1,3}\.){3}[0-9]{1,3}(\/(3[0-2]|[1-2][0-9]|[0-9]))$'
            - pattern: '^([0-9]{1,3}\.){3}[0-9]{1,3}-([0-9]{1,3}\.){3}[0-9]{1,3}$'
        avoid-buggy-ips:
          type: boolean
          default: false
          description: |
            Prevents addresses ending with `.0` and `.255` to be used by a pool.
x-examples:
- addressPools:
  - name: my-l2-loadbalancer-pool
    addresses:
      - 192.168.100.1-192.168.100.10
      - 192.168.101.0/24
